home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Development Platforms / Apple II / Essentials / MPW IIGS Interfaces / PIIGSIncludes / Print.p < prev    next >
Encoding:
Text File  |  1990-04-03  |  5.8 KB  |  151 lines  |  [TEXT/MPS ]

  1. {********************************************
  2. ; File: Print.p
  3. ;
  4. ;
  5. ; Copyright Apple Computer, Inc. 1986-90
  6. ; All Rights Reserved
  7. ;
  8. ********************************************}
  9.  
  10. UNIT PRINT;
  11. INTERFACE
  12. USES TYPES,QUICKDRAW,EVENTS,CONTROLS,WINDOWS,LINEEDIT,DIALOGS;
  13. CONST
  14.  
  15.  
  16. { Error Codes }
  17. pntrConFailed = $1308;  { connection to the printer failed }
  18. memFullErr = $FF80;
  19. ioAbort = $FFE5;
  20. prAbort = $0080;
  21. missingDriver = $1301;  { specified driver not in system/drivers }
  22. portNotOn = $1302;  { specified port not selected in ctl panel }
  23. noPrintRecord = $1303;  { no print record was given }
  24. badLaserPrep = $1304;  { laser prep in laser writer incompatible }
  25. badLPFile = $1305;  { laser prep in system/drivers incompatible }
  26. papConnNotOpen = $1306;  { cannot connect to laser writer }
  27. papReadWriteErr = $1307;  { apple talk PAPRead or PAPWrite error }
  28. ptrConnFailed = $1308;  { cannot establish connection with imagewriter }
  29. badLoadParam = $1309;  { parameter for load/unload is invalid }
  30. callNotSupported = $130A;  { toolcall made is not supported by this version }
  31. startUpAlreadyMade = $1321;  { low level startup already made }
  32. invalidCtlVal = $1322;  { invalid control value had been spec'd }
  33.  
  34. { whichDriver Codes }
  35. bothDrivers = $0;  { input to PMLoadDriver and PMUnloadDriver }
  36. printerDriver = $0001;  { input to PMLoadDriver and PMUnloadDriver }
  37. portDriver = $0002;  { input to PMLoadDriver and PMUnloadDriver }
  38.  
  39. { Other Constants }
  40. prPortrait = $0000;
  41. prLandscape = $0001;
  42. prImageWriter = $0001;
  43. prImageWriterLQ = $0002;
  44. prLaserWriter = $0003;
  45. prEpson = $0004;
  46. prBlackWhite = $0001;
  47. prColor = $0002;
  48. bDraftLoop = $0000;
  49. bSpoolLoop = $0080;
  50.  
  51. TYPE
  52. PrPrinterSpecRec = RECORD
  53.     prPrinterType : Integer;
  54.     prCharacteristics : Integer;
  55. END;
  56. PrInfoRecHndl = ^PrInfoRecPtr;
  57. PrInfoRecPtr = ^PrInfoRec;
  58. PrInfoRec = RECORD
  59.     iDev : Integer; { reserved for internal use }
  60.     iVRes : Integer; { vertical resolution of printer }
  61.     iHRes : Integer; { horizontal resolution of printer }
  62.     rPage : Rect; { defining page rectangle }
  63. END;
  64. PrJobRecPtr = ^PrJobRec;
  65. PrJobRec = PACKED RECORD
  66.     iFstPage : Integer; { first page to print }
  67.     iLstPage : Integer; { last page to print }
  68.     iCopies : Integer; { number of copies }
  69.     bJDocLoop : Byte; { printing method }
  70.     fFromUser : Byte; { used internally }
  71.     pIdleProc : WordProcPtr; { background procedure }
  72.     pFileName : Ptr; { spool file name }
  73.     iFileVol : Integer; { spool file volume reference number }
  74.     bFileVers : Byte; { spool file version number }
  75.     bJobX : Byte; { used internally }
  76. END;
  77. PrStyleRecHndl = ^PrStyleRecPtr;
  78. PrStyleRecPtr = ^PrStyleRec;
  79. PrStyleRec = RECORD
  80.     wDev : Integer; { output quality information }
  81.     internA : ARRAY[1..3] OF Integer; { for internal use }
  82.     feed : Integer; { paper feed type }
  83.     paperType : Integer; { paper type }
  84.     crWidth : Integer; { carriage Width for image writer or vertical sizing for lazer writer }
  85.     reduction : Integer; { % reduction, laser writer only }
  86.     internB : Integer; { for internal use }
  87. END;
  88. PrRecHndl = ^PrRecPtr;
  89. PrRecPtr = ^PrRec;
  90. PrRec = RECORD
  91.     prVersion : Integer; { print manager version }
  92.     prInfo : PrInfoRec; { printer infomation subrecord }
  93.     rPaper : Rect; { Defining paper rectangle }
  94.     prStl : PrStyleRec; { style subrecord }
  95.     prInfoPT : PACKED ARRAY[1..14] OF Byte; { reserved for internal use }
  96.     prXInfo : PACKED ARRAY[1..24] OF Byte; { reserved for internal use }
  97.     prJob : PrJobRec; { job subrecord }
  98.     printX : PACKED ARRAY[1..38] OF Byte; { reserved for future use }
  99.     iReserved : Integer; { reserved for internal use }
  100. END;
  101. PrStatusRecHndl = ^PrStatusRecPtr;
  102. PrStatusRecPtr = ^PrStatusRec;
  103. PrStatusRec = RECORD
  104.     iTotPages : Integer; { number of pages in spool file }
  105.     iCurPage : Integer; { page being printed }
  106.     iTotCopies : Integer; { number of copies requested }
  107.     iCurCopy : Integer; { copy being printed }
  108.     iTotBands : Integer; { reserved for internal use }
  109.     iCurBand : Integer; { reserved for internal use }
  110.     fPgDirty : Boolean; { TRUE if started printing page }
  111.     fImaging : Integer; { reserved for internal use }
  112.     hPrint : PrRecHndl; { handle of print record }
  113.     pPrPort : GrafPortPtr; { pointer to grafport being use for printing }
  114.     hPic : Longint; { reserved for internal use }
  115. END;
  116. PROCEDURE PMBootInit   ;
  117. PROCEDURE PMLoadDriver ( whichDriver:Integer)  ;
  118. PROCEDURE PMReset   ;
  119. PROCEDURE PMShutDown   ;
  120. PROCEDURE PMStartUp ( userID:Integer; dPageAddr:Integer)  ;
  121. FUNCTION PMStatus  : Boolean ;
  122. PROCEDURE PMUnloadDriver ( whichDriver:Integer)  ;
  123. FUNCTION PMVersion  : Integer ;
  124. FUNCTION PrChoosePrinter  : Boolean ;
  125. FUNCTION PrChooser  : Boolean ;
  126. PROCEDURE PrCloseDoc ( printGrafPortPtr:GrafPortPtr)  ;
  127. PROCEDURE PrClosePage ( printGrafPortPtr:GrafPortPtr)  ;
  128. PROCEDURE PrDefault ( printRecordHandle:PrRecHndl)  ;
  129. FUNCTION PrDriverVer  : Integer ;
  130. FUNCTION PrError  : Integer ;
  131. FUNCTION PrGetDocName  : StringPtr ;
  132. FUNCTION PrGetNetworkName  : StringPtr ;
  133. FUNCTION PrGetPgOrientation ( prRecordHandle:PrRecHndl) : Integer ;
  134. FUNCTION PrGetPortDvrName  : StringPtr ;
  135. FUNCTION PrGetPrinterDvrName  : StringPtr ;
  136. FUNCTION PrGetPrinterSpecs  : PrPrinterSpecRec ;
  137. FUNCTION PrGetUserName  : StringPtr ;
  138. FUNCTION PrGetZoneName  : StringPtr ;
  139. FUNCTION PrJobDialog ( printRecordHandle:PrRecHndl) : Boolean ;
  140. FUNCTION PrOpenDoc ( printRecordHandle:PrRecHndl; printGrafPortPtr:GrafPortPtr) : GrafPortPtr ;
  141. PROCEDURE PrOpenPage ( printGrafPortPtr:GrafPortPtr; pageFramePtr:RectPtr)  ;
  142. PROCEDURE PrPicFile ( printRecordHandle:PrRecHndl; printGrafPortPtr:GrafPortPtr; statusRecPtr:PrStatusRecPtr)  ;
  143. PROCEDURE PrPixelMap ( srcLocPtr:LocInfo; srcRectPtr:Rect; colorFlag:Boolean)  ;
  144. FUNCTION PrPortVer  : Integer ;
  145. PROCEDURE PrSetDocName ( DocNamePtr:StringPtr)  ;
  146. PROCEDURE PrSetError ( errorNumber:Integer)  ;
  147. FUNCTION PrStlDialog ( printRecordHandle:PrRecHndl) : Boolean ;
  148. FUNCTION PrValidate ( printRecordHandle:PrRecHndl) : Boolean ;
  149. IMPLEMENTATION
  150. END.
  151.